n,m,y = map(int,input().split())

n_data = { x:i for i,x in enumerate(list(map(int,input().split())))}

m_data = { x:i for i,x in enumerate(list(map(int,input().split())))}

for d in n_data:
    num = y-d
    # get(num) == 0 那么相当于是False,为了防止这种情况，需要再次判断一下
    if m_data.get(num,False) is not False:
        print(n_data[d],m_data[y-d])
    